<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<legend>Shopping Cart</legend>
<table class="table table-condensed">
	<tr>
		<th>#</th>
		<th>NAME</th>
		<th>PRICE</th>
		<th>QUANTITY</th>
		<th></th>
	</tr>
	<c:forEach items="${order.productOrders}" var="productOrder" varStatus="counter">
		<tr>
			<td>${counter.count}</td>
			<td>${productOrder.product.name}</td>
			<td>${productOrder.product.price}</td>
			<td align="center">${productOrder.quantity}</td>
			<td>
				<a onclick="deleteFromCart(${productOrder.product.id})">
					<span class="glyphicon glyphicon-remove-circle text-danger"></span>
				</a>
			</td>
		</tr>
	</c:forEach>
	<tr>
		<td colspan="2"/>
		<th colspan="3">Total Price: ${order.price}</th>
	</tr>
</table>

<a href="clearCart">Clear Shopping Cart</a>